from rest_framework.views import exception_handler

def custom_exception_handler(exc, context):
    print(exc, context)

    response = exception_handler(exc, context)

    print(response)
    print(type(response))

    if response is not None:
        response.data['status_code'] = response.status_code

    return response